/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ch.bbcnet.awesomeplayer;

import com.sun.java.swing.plaf.windows.WindowsLookAndFeel;
import java.util.Arrays;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

/**
 *
 * @author efellf
 */
public class AwesomePlayer {

    

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws Exception {
        new AwesomePlayer();
    }
    
    
    
    public AwesomePlayer() throws Exception {
        XML xml = XML.getInstance();
        if (System.getProperty("os.name").contains("Windows")) {
            xml.setAuthXMLPath(System.getenv("appdata")+"\\AwesomePlayer\\auth.xml");
            xml.setXMLPath(System.getenv("appdata")+"\\AwesomePlayer\\playlists.xml");
            xml.startUpRoutine("\\\\");
            try {
                UIManager.setLookAndFeel(new WindowsLookAndFeel());
            } catch (UnsupportedLookAndFeelException ex) {
                Logger.getLogger(AwesomePlayer.class.getName()).log(Level.SEVERE, null, ex);
            }
        } else if (System.getProperty("os.name").contains("Mac")) {
            System.out.println("Mac!");
            xml.setXMLPath("~/Library/Application Support/AwesomePlayer/playlists.xml");
        } else if(System.getProperty("os.name").contains("Linux")) {
            System.out.println("Linux!");
            xml.setAuthXMLPath("/usr/bin/AwesomePlayer/auth.xml");
            xml.setXMLPath("/usr/bin/AwesomePlayer/playlists.xml");
            xml.startUpRoutine("/");
        } else{
            throw new Exception("Unsupported OS");
        }
        new Gui();
    }
}
